#include<stdio.h>
void main(){
	int m,a,b,c;
	for(m=100;m<=999;m++){
		a=m%10;
		b=m/10%10;
		c=m/100%10;
		int d = (a*a*a)+(b*b*b)+(c*c*c);
		if(m == d)
			printf("%d\n",m);
	}
}
